<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui"
      xmlns:c="http://java.sun.com/jsp/jstl/core">

    <body>

        <ui:composition template="./../Template.xhtml">


            <ui:define name="content">

                <f:view>
                    <h:form id="professor">
                        <p:growl id="growl"/>   

                        <p:panel header="Cadastro do Professor" id="cadProf">


                            <p:panel header="Dados Pessoais"  id="dadosPessoais">


                                <h:panelGrid columns="2" id="dados">


                                    <h:outputText value="Nome.:*"/>
                                    <p:inputText value="#{professorFaces.selectedProfessor.nome}" size="40" required="true"  label="Nome" id="Nome">
                                        <f:validateLength minimum="4"/>
                                    </p:inputText>

                                    <h:outputText value="E-mail.:*"/>
                                    <p:inputText value="#{professorFaces.selectedProfessor.email}" size="40" required="true" label="E-mail" id="E-mail">
                                        <f:validateLength minimum="6"/>
                                    </p:inputText>

                                    <h:outputText value="CPF.:*"/>
                                    <p:inputMask value="#{professorFaces.selectedProfessor.cpf}" mask="999.999.999-99" required="true"  label="CPF" id="CPF">
                                        <f:validateLength minimum="6"/>
                                    </p:inputMask>

                                    <h:outputText value="Formação.:*"/>
                                    <p:inputText value="#{professorFaces.selectedProfessor.formacao}" size="40" label="Formacao" id="Formacao">
                                        <f:validateLength minimum="2"/>
                                    </p:inputText>

                                    <h:outputText value="Fone Fixo.:"/>
                                    <p:inputMask value="#{professorFaces.selectedProfessor.fone1}" mask="(99)9999-9999" size="15"  id="Telefone" label="Telefone" >
                                        <f:validateLength minimum="8"/>
                                    </p:inputMask>

                                    <h:outputText value="Celular.:*"/>
                                    <p:inputMask value="#{professorFaces.selectedProfessor.fone2}" mask="(99)9999-9999" size="15" required="true" id="Celular" label="Celular"/>
                                </h:panelGrid>
                            </p:panel>
                            <p:panel header="Endereço"   id="dadosEndereco">


                                <h:panelGrid columns="2" id="endereço" >

                                    <h:outputText value="Rua.:*"/>
                                    <p:inputText value="#{professorFaces.selectedEndereco.rua}" size="40" maxlength="100" required="true" label="Rua" id="Rua">
                                        <f:validateLength minimum="4"/>´
                                    </p:inputText>

                                    <h:outputText value="Bairro.:*"/>
                                    <p:inputText value="#{professorFaces.selectedEndereco.bairro}" size="40" maxlength="100" required="true"  label="Bairro" id="Bairro">
                                        <f:validateLength minimum="4"/>´
                                    </p:inputText>

                                    <h:outputText value="Número.:*"/>
                                    <p:inputText value="#{professorFaces.selectedEndereco.numero}" size="4" maxlength="4" required="true" label="Numero" id="Numero" >
                                        <f:validateLength minimum="1"/>´
                                    </p:inputText>

                                    <h:outputText value="Cep.:*"/>
                                    <p:inputMask value="#{professorFaces.selectedEndereco.cep}" size="10" mask="99999-999" required="true" label="CEP" id="CEP">
                                        <f:validateLength minimum="8"/>

                                    </p:inputMask>

                                    <h:outputText value="Cidade.:*"/>
                                    <p:inputText value="#{professorFaces.selectedEndereco.cidade}" maxlength="60" required="true" label="Cidade" id="Cidade">
                                        <f:validateLength minimum="2"/>´
                                    </p:inputText>


                                    <h:outputText value="Estado.:*"/>
                                    <p:inputText value="#{professorFaces.selectedEndereco.estado}" size="2" maxlength="2" required="true"  label="Estado" id="Estado">
                                        <f:validateLength maximum="2"/>´
                                    </p:inputText>

                                    <h:outputText value="Inform. Gerais.:"/>
                                    <p:inputText value="#{professorFaces.selectedEndereco.outros}" size="40" maxlength="120" label="Geral" id="Geral"/>


                                </h:panelGrid>
                            </p:panel>
                            <p:panel header="Cursos e Formações" >


                                <h:panelGrid columns="2" style="text-align:  center" id="cursos">

                                    <h:outputText value="IED - Introd. a Educação Digital(60h)"/>
                                    <p:selectBooleanCheckbox value="#{professorFaces.selectedCurso.ied60}" />
                                    <h:outputText value="TICS - Tec. da Informação e suas Tecnologias(60h)"/>
                                    <p:selectBooleanCheckbox value="#{professorFaces.selectedCurso.tics60}"/>
                                    <h:outputText value="Elaboração de Projetos(40h)"/>
                                    <p:selectBooleanCheckbox value="#{professorFaces.selectedCurso.elabProj40}"/>
                                    <h:outputText value="Redes de Aprendizagem(40h)"/>
                                    <p:selectBooleanCheckbox value="#{professorFaces.selectedCurso.redesAprend}"/>
                                    <h:outputText value="Outros:"/>
                                    <p:inputTextarea value="#{professorFaces.selectedCurso.outros}" maxlength="255" autoResize="true" counter="counter8"  counterTemplate="{0} Caracteres Restantes." />
                                    <h:inputHidden /> <h:outputText id="counter8" /> 

                                </h:panelGrid>
                            </p:panel>

                            <p:panel header="Plano de ação" id="planoacao3">



                                <h:panelGrid columns="2" id="plano" > 

                                    <h:outputText value="Escola.:"/>
                                    <p:selectOneMenu value="#{professorFaces.selectedEscola}" converter="EscolaConverter" id="selectEscola">
                                        <f:selectItem itemLabel="Selecione" itemValue="#{null}"/>
                                        <f:selectItems value="#{escolaFaces.allEscolas}" var="esc" itemLabel="#{esc.escola}" itemValue="#{esc}"/>
                                    </p:selectOneMenu>

                                    <h:outputText value="Data de Início.:*"/>
                                    <p:calendar value="#{professorFaces.planoacao.data_inicio}" id="data_inicial"  required="true" label="Data Inicial"/>
                                    <h:outputText value="Data do Fim.:*"/>
                                    <p:calendar value="#{professorFaces.planoacao.data_fim}" id="data_final"  required="true"  label="Data Final"/>
                                    <h:outputText value="Título.:*"/>
                                    <p:inputText value="#{professorFaces.planoacao.titulo}" id="titulo" label="Título" size="70" maxlength="200"  />
                                    <h:outputText value="Objetivo Geral.:*"/>
                                    <p:inputTextarea value="#{professorFaces.planoacao.geral}" id="geral" label="Objetivo Geral"  required="true" maxlength="300" cols="50" rows="5" autoResize="false" counter="counter"  counterTemplate="{0} Caracteres Restantes."  />
                                    <h:inputHidden /> <h:outputText id="counter" />
                                    <h:outputText value="Objetivo Específico.:*"/>
                                    <p:inputTextarea value="#{professorFaces.planoacao.especifico}" id="especifico" label="Objetivo Específico"  required="true" maxlength="300"  cols="50" rows="5"  autoResize="false" counter="counter2"  counterTemplate="{0} Caracteres Restantes."  />
                                    <h:inputHidden /> <h:outputText id="counter2" />
                                    <h:outputText value="Justificativa.:*"/>
                                    <p:inputTextarea value="#{professorFaces.planoacao.justificativa}" id="justificativa" label="Justificativa"   maxlength="300"  cols="50" required="true" rows="5" autoResize="false" counter="counter3"  counterTemplate="{0} Caracteres Restantes."  />
                                    <h:inputHidden /> <h:outputText id="counter3" />
                                    <h:outputText value="Cronograma de Execução.:*"/>
                                    <p:inputTextarea value="#{professorFaces.planoacao.cronograma}" id="cronograma" label="Cronograma de Execução"   maxlength="300"  cols="50" required="true" rows="5" autoResize="false" counter="counter4"  counterTemplate="{0} Caracteres Restantes."  />
                                    <h:inputHidden /> <h:outputText id="counter4" /> 
                                    <h:outputText value="Metas/Resultados Esperados.:*"/>
                                    <p:inputTextarea value="#{professorFaces.planoacao.metas}" id="metas" label="Metas"   maxlength="300"  cols="50" required="true" rows="5" counter="counter5"  counterTemplate="{0} Caracteres Restantes." />
                                    <h:inputHidden /> <h:outputText id="counter5" />
                                    <h:outputText value="Indicadores dos Resultados.:*"/>
                                    <p:inputTextarea value="#{professorFaces.planoacao.resultados}" id="indicadores" label="Indicadores de Resultados"   maxlength="300"  cols="50" required="true" rows="5" autoResize="false" counter="counter6"  counterTemplate="{0} Caracteres Restantes."  />
                                    <h:inputHidden /> <h:outputText id="counter6" />
                                    <h:outputText value="Observações.:*"/>
                                    <p:inputTextarea value="#{professorFaces.planoacao.observacoes}" id="observacoes" label="Observações"   maxlength="300" cols="50" required="true" rows="5" autoResize="false" counter="counter7"  counterTemplate="{0} Caracteres Restantes." />
                                    <h:inputHidden /> <h:outputText id="counter7" />
                                </h:panelGrid>




                                <p:messages id="message"/>
                                <br/><br/>
                                <h:outputText value=" ATENÇÃO: Os dados só serão salvos se todas as informações das abas forem preenchidas!!" style="color: #D20005"/>
                                <h:panelGrid columns="2" style="text-align: center">

                                    <p:commandButton value="Novo"  update="professor:cadProf" process="@this" actionListener="#{professorFaces.reset}"  style="background-color: slategray"/>
                                    <p:commandButton id="saveBtn"  value="Gravar" update="message"   icon="ui-icon-check" style="margin: 0" action="#{professorFaces.addProfessor()}" immediate="false"  />


                                </h:panelGrid>

                            </p:panel>
                        </p:panel>
                    </h:form>
                </f:view>
            </ui:define>



        </ui:composition>

    </body>
</html>
